import {request} from '@/utils/request';
import {PageParams} from "@/api/model/pageParams";

/**
 * 用户分页查询
 * @param params
 */
const page = async (params: PageParams) => {
    return request.post({
        url: '/user/page',
        data: params
    });
}

/**
 * 用户分页查询
 * @param params
 */
const list = async (params: PageParams) => {
    return request.post({
        url: '/user/list',
        data: params
    });
}

const insert = async (data: any) => {
    return request.post({
        url: '/user/insert',
        data
    });
}

const update = async (data: any) => {
    return request.post({
        url: '/user/update',
        data
    });
}

const deleteById = async (id: string) => {
    return request.get({
        url: `/user/delete/${id}`,
    });
}

export {
    page,
    list,
    insert,
    update,
    deleteById
}
